<template>
  <div class="wawa-action">
    <!--<div class="title-bar">-->
      <!--<div class="back" @click="back"><</div>-->
      <!--<div class="title">积分管理</div>-->
    <!--</div>-->
    <div class="tabs">
      <div class="tab" @click="toggleTab(0)" v-bind:class="{active:currentTab==='SaveWawa'}">存娃娃</div>
      <div class="tab" @click="toggleTab(1)" v-bind:class="{active:currentTab==='Changewawa'}">换娃娃</div>
    </div>
    <keep-alive>
      <component v-bind:is="currentTab"></component>
    </keep-alive>
  </div>
</template>

<script>
  import SaveWawa from '../components/SaveWawa.vue';
  import Changewawa from '../components/Changewawa.vue';
    export default {
      data(){
        return {
          currentTab:'SaveWawa'
        }
      },
        name: "wawa-action",
        components:{
          SaveWawa,
          Changewawa
        },
      methods:{
        toggleTab(tab){
          if (tab == 0){
            this.currentTab = "SaveWawa"
          }else{
            this.currentTab = "Changewawa"
          }
        },
        back(){
          this.$router.back()
        }
      }
    }
</script>

<style scoped>
  .title-bar{
    width: 100%;
    height: 44px;
    background:linear-gradient(360deg,rgba(44,45,49,1) 0%,rgba(16,16,19,1) 100%);
  }
  .back{
    float: left;
    font-size:22px;
    font-family:PingFangSC-Medium;
    font-weight:500;
    color:rgba(255,255,255,1);
    line-height:44px;
    text-align: center;
    padding-left: 10px;
  }
  .title{
    font-size:18px;
    font-family:PingFangSC-Medium;
    font-weight:500;
    color:rgba(255,255,255,1);
    line-height:44px;
    text-align: center;
  }
  .wawa-action{

    width: 100%;
    height: 100%;

    background:rgba(239,239,244,1);
  }
  .tabs{
    width: 100%;
    height: 47px;
    background: #fff;
  }
  .tab{
    width: 50%;
    height: 47px;
    font-size:17px;
    font-family:PingFangSC-Regular;
    font-weight:400;
    color:rgba(53,53,53,1);
    line-height:47px;
    float: left;
    text-align: center;
  }
  .active{
    border-bottom: 1px solid rgba(254,108,136,1);
    font-size:17px;
    font-family:PingFangSC-Regular;
    font-weight:400;
    color:rgba(254,108,136,1);
    line-height:47px;
  }

</style>
